-
Notifications
You must be signed in to change notification settings - Fork 32
✨ [Frontend] Conversation Messages: Listen to WebSocket #7963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ [Frontend] Conversation Messages: Listen to WebSocket #7963
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the conversation messages UX by integrating WebSocket events for creating, updating, and deleting messages while refactoring event names and message handling methods.
- Introduces WebSocket event listeners to handle real-time message updates.
- Refactors message-related functions and events (e.g., from "messageEdited" to "messageUpdated") in multiple components.
- Adjusts conversation loading and message insertion logic to support real-time updates.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| services/static-webserver/client/source/class/osparc/study/Conversations.js | Added WebSocket listener setup and updated message deletion API call. |
| services/static-webserver/client/source/class/osparc/conversation/NotificationUI.js | Refactored to use property-based message handling. |
| services/static-webserver/client/source/class/osparc/conversation/MessageUI.js | Updated event names and switched from instance variables to properties. |
| services/static-webserver/client/source/class/osparc/conversation/Conversation.js | Modified message fetching to use reloading method and adjusted message insertion order. |
| services/static-webserver/client/source/class/osparc/conversation/AddMessage.js | Revised event notifications to align with updated messaging event names. |
Comments suppressed due to low confidence (2)
services/static-webserver/client/source/class/osparc/study/Conversations.js:273
- Verify that socket.removeSlot(eventName) properly unregisters the specific event handlers added with socket.on. It might be more robust to pass both the event name and the handler reference to ensure correct clean-up.
socket.removeSlot(eventName);
services/static-webserver/client/source/class/osparc/study/Conversations.js
Show resolved
Hide resolved
giancarloromeo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌 🚀
|
Very nice!
|
pcrespov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀
@matusdrobuliak66 suggested it in a previous PR, the problem is that we don't keep track of deleted messages |
|
@mergify queue |
|
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at f98ad3a |
@odeimaiz @matusdrobuliak66 here is an idea: instead of deleting a message, you edit it with a reserved word like |



What do these changes do?
This PR makes the Conversations listen the WebSocket events, reducing the GET messages calls and giving a better UX.
Related issue/s
How to test
Dev-ops